<?php 
	class Utils {
		public static function getPageFromURL(){
			$p = "tasks";
			if(isset($_GET["page"]))
				$p = $_GET["page"];
			return $p;
		}
	
		public static function getTaskIdFromURL(){
			$taskid = 0;
			if(isset($_GET["taskId"])){
				$taskid = $_GET["taskId"];
			}
			return $taskid;
		}
	
		public static function makeUrl($page){
			$sid = $_GET["sid"];
			return "index.php?sid=$sid&page=$page";
		}
		
		public static function makeTaskDetailUrl($taskid){			
			return Utils::makeUrl("taskdetails")."&taskid=$taskid";
		}

		public static function makeReportDetailUrl($reportid){			
			return Utils::makeUrl("reportdetails")."&reportid=$reportid";
		}
		
		public static function makeTasksUrl(){			
			return Utils::makeUrl("tasks");
		}
		
		public static function makeTaskPriorityUrl() { 
			return Utils::makeUrl("taskpriorities");
		}
		
		public static function makeTaskPriorityDetailUrl($taskpriorityid) { 
			return Utils::makeUrl("taskprioritydetails")."&taskpriorityid=$taskpriorityid";
		}
		
		public static function makeTaskTimeUrl($taskid) {
			return Utils::makeUrl("tasktime")."&taskid=$taskid";
		}
		
		public static function makeTaskTimeDetailUrl($taskid,$tasktimeid) {
			return Utils::makeUrl("tasktimedetails")."&taskid=$taskid&tasktimeid=$tasktimeid";
		}
		
		public static function makeUserUrl() {
			return Utils::makeUrl("users");
		}
		
		public static function makeUserDetailUrl($userid){ 
			return Utils::makeUrl("userdetails")."&userid=$userid";
		}
		
		public static function makeProjectsUrl() { 
			return Utils::makeUrl("projects");
		}
		
		public static function makeProjectDetailUrl($projectId){
			return Utils::makeUrl("projectdetails")."&projectId=$projectId";
		}
	}
?>
